# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pyname='resumable-urlretrieve'
pkgname='python-resumable-urlretrieve'
pkgver=0.1.6
pkgrel=6
pkgdesc='Small library to fetch files over HTTP and resuming their download'
url='https://github.com/berdario/resumable-urlretrieve'
arch=('any')
license=('MIT')
depends=('python' 'python-requests')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-rangehttpserver')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/berdario/resumable-urlretrieve/archive/${pkgver}.tar.gz)
sha256sums=('a7c390b826e8bd76611a39b6f0e8af73c55871767c674fcd8373a25b2bcdd1c2')
sha512sums=('2bff31f0635754e1a6a703ad2fc619a7b047b5f4cc32a9c5d613d570cdec349a9d026238f971509c7a0086593a88b0cdfd1e90c85ad2f54935cd3883fd785d18')

build() {
  cd ${_pyname}-${pkgver}
  python setup.py build
}

check() {
  cd ${_pyname}-${pkgver}
  PYTHONPATH=. py.test
}

package() {
  cd ${_pyname}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 README.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim: ts=2 sw=2 et:
